package com.itboye.sunsun.adapter;

import java.util.List;

import com.itboye.sunsun.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;

public class SendListViewAdapter extends BaseAdapter {

	private Context context;
	private List list;

	public SendListViewAdapter(Context context, List list) {
		this.context = context;
		this.list = list;

	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return list.get(arg0);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	final class ViewHolder {

		Button selectButton;

	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		ViewHolder hold = null;
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(
					R.layout.order_listview_item_send, null);
			hold = new ViewHolder();
			hold.selectButton = (Button) convertView.findViewById(R.id.contact);
			convertView.setTag(hold);
		} else {
			hold = (ViewHolder) convertView.getTag();
		}

		return convertView;
	}

}
